package assembler;

import java.util.HashMap;

public class OP {
	static boolean isInit=false;
	static HashMap<String,String> op=new HashMap();
	public static String get(String key){
		if(isInit==false){
			init();
		}
		return op.get(key);
	}
	public static void init(){
		op.put("add",  "000000000001");
		op.put("sub",  "000000000010");
		op.put("mul",  "000000000011");
		op.put("and",  "000001000001");
		op.put("or",   "000001000010");
		op.put("xor",  "000001000100");
		op.put("sra",  "000010000001");
		op.put("srl",  "000010000010");
		op.put("sll",  "000010000011");
		op.put("jreg", "000010000100");
		op.put("addi", "000101");
		op.put("muli", "000111");
		op.put("andi", "001001");
		op.put("ori",  "001010");
		op.put("xori", "001100");
		op.put("load", "001101");
		op.put("store","001110");
		op.put("beq",  "001111");
		op.put("bne",  "010000");
		op.put("lui",  "010001");
		op.put("jump", "010010");
		op.put("jal",  "010011");
	}
}
